﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GetScore.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.GetScore" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no;">
    <title>兑换积分</title>
    <script src="../lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <style>
        html
        {
            width: 100%;
            height: 100%;
        }
        body
        {
            margin: 0;
            height: 100%;
            position: relative;
            width: 100%;
        }
        .allcenter
        {
            width: 100%;
            padding: 10px 20px;
            box-sizing: border-box;
            text-align: center;
            position: absolute;
            left: 0;
            top: 1%;
        }
        .inputtext
        {
            width: 70%;
            display: inline-block;
            height: 30px;
            border: 1px solid #ccc;
            margin-bottom: 10px;
            border-radius: 5px;
            padding-left: 5px;
            font-size: 14px;
        }
        .btn
        {
            height: 33px;
            display: inline-block !important;
            margin: 0 auto;
            width: 20%;
            font-size: 14px;
            border-radius: 5px;
            background: #5262ff;
            color: #fff;
            border: none;
        }
        .allcenter .bangding
        {
            text-align: left;
            margin: 5px 0 10px 0px;
            color: #545454;
        }
        .say
        {
            text-align: left;
            color: #545454;
            margin-top: 5px;
        }
        .say h4
        {
            margin: 0;
            font-weight: normal;
            margin-bottom: 5px;
        }
        .say p
        {
            margin: 5px 0;
            line-height: 25px;
            font-size: 15px;
        }
        .topinput
        {
            width: 100%;
            overflow: hidden;
            text-align: left;
        }
    </style>
<!--#include file="/Code/StatCode/userstat.inc" -->
</head>
<body>
    <div class="allcenter">
        <p class="bangding">
            请输入兑换码:</p>
        <div class="topinput">
            <input type="text" class="inputtext center" id="TargetCode" placeholder="兑换码" />
            <input type="text" class="inputtext center" id="CheckCode" placeholder="输入验证码" />
            <img id="checkcode" style="display: none; position: absolute; top: 8.5%; right: 2%; width: 23%;
                border: 1px solid #D5D5D5" src="" onclick="this.src+=Math.random()" alt="验证码" />
            <div>
                <input type="button" value="提交" onclick="Bind(this)" class="btn">
            </div>
        </div>
        <div class="say">
            <h4>
                流程说明:</h4>
            <p>
                <span>1、输入积分密码和验证码，兑换积分。</span>
            </p>
            <p>
                <span>2、兑换成功后，在【个人中心】中查看积分。</span>
                <br>
                <img src="/wap/shop/images/getscore1.png" style="width: 100%; border: 1px solid #ccc; margin-top: 10px;" />
            </p>
            <p>
                <span>3、下单支付时采用积分抵扣。</span>
                <br>
                <img src="/wap/shop/images/getscore2.png" style="width: 100%; border: 1px solid #ccc; margin-top: 10px;" />
            </p>
            <p>
            <span>4.如果使用过程中遇到问题，<a href="/wap/shop/KFList.aspx" data-ajax="false">请联系客服</a></span>
            </p>
        </div>
    </div>
    <script>
        $(function () {
            showCheckcode();
        })
        function showCheckcode() {
            if ($('#checkcode').attr("src"))
                return;
            $('#checkcode').show();
            $('#checkcode').attr("src", "/Tools/CheckCode.aspx?v=" + Math.random() * 9999999);
            $('#checkcode').click();
        }
        function Bind(el) {
            if ($.trim($("#TargetCode").val()) == "") {
                alert("请输入微信号"); return;
            }

            var params = {"Code":$("#TargetCode").val(),"CheckCode": $("#CheckCode").val() };
            $.ajax({
                type: "post",
                url: "/wap/shop/GetScore.aspx",
                data: params,
                dataType: "json",
                success: function (data) {
                    if (data.ErrorCode == "0000") {
                        alert("获取积分成功");
                        location.href = "/wap/shop/default.aspx";
                    } else {
                        alert(data.ErrorMsg);
                    }
                },
                error: function (err) {
                    alert(err);
                }
            });

        }
    </script>
</body>
</html>
